const Todo = require("../models/todo");

const todoController = {
  showTodo: async (req, res, next) => {
    try {
      let todoData = await Todo.all();
      res.json({
        code: 200,
        message: "success",
        data: todoData,
      });
    } catch (err) {
      res.json({
        code: 0,
        message: "fail",
        data: err,
      });
    }
  },
};

module.exports = todoController;
